#pragma once

#include <stdio.h>

#define SM4_Rotl32(buf, n) (((buf)<<n)|((buf)>>(32-n)))
extern unsigned char SM4_Sbox[256];
extern unsigned int SM4_CK[32];
extern unsigned int SM4_FK[4];

void SM4_KeySchedule(unsigned char MK[], unsigned int rk[]);
void SM4_Encrypt(unsigned int rk[], unsigned char PlainText[], unsigned char CipherText[]);
void SM4_Decrypt(unsigned int rk[], unsigned char CipherText[], unsigned char PlainText[]);
